package 期末复习;

public class person {

       private int age;


    public void setAge(int age) {

        if (age < 0 || age > 100) {
            System.out.println("合法");
        } else {
            System.out.println("不合法");
            this.age = age;
        }
    }


    public int getAge() {
        return this.age;
    }

}

